﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MultiPhotoChooser
{
    public class PictureItemList : IDisposable
    {   
        public PictureItemList()
        {
            if (Items == null)
                Items = new List<PictureItem>();
        }

        public List<PictureItem> Items { get; set; }

        public void Dispose()
        {
            Dispose(true); //i am calling you from Dispose, it's safe
            Items = null;
        }

        private void Dispose(bool p)
        {
            foreach (var item in Items)
                item.Dispose();
        }

    }
}
